package com.bootcamp.mall.dao;

import com.bootcamp.mall.model.User;
import com.bootcamp.mall.model.bo.user.UpdateUserDataBO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @program: mall
 * @description: crud for user management system
 * @author: Keyu Li
 * @create: 2021-11-09 20:03
 **/

public interface UserDao {
    List<User> selectAllUsers();

    Integer deleteUserById(Integer id);

    String selectUsernameById(Integer id);

    List<User> selectUserByNickname(String nickname);

    /**
     * 返回 userId
     *
     * @param nickname:
     * @return java.lang.Integer
     * @date 11/12/2021 21:29
     */
    Integer selectIdByNickname(@Param("nickname") String nickname);

    User selectUserByPreciseNickname(@Param("nickname") String nickname);

    Integer updateUser(UpdateUserDataBO userBO);
}
